<script type="text/javascript" src="<?=BASE_URL();?>java_scripts/vote_scripts.js"></script>
<div>
<?php 
	$error_msg=(!isset($error))?"":$error;
?>
   <table border="0" width="100%">
      <tr>
      	<td style="font-size: 20px;font-weight: bold;">Update - Vote Topic</td>
      </tr>
      <tr>
      	<td align="center">
	      	<form action="" method="post">
	      		<?php 
	      			foreach($topics->result_array() as $topic){	
		      			$id=(!isset($error))?$topic['top_id']:$top_id;
		      			$top_name=(!isset($error))?$topic['top_name']:$top_name;
		      			$top_desc=(!isset($error))?$topic['top_desc']:$top_desc;
		      			$max=(!isset($error))?$topic['top_item_max']:$max_item;
	      		?>
	      		<table border="0" cellpadding="0" cellspacing="0" width="80%">
	      			<tr align="center">
	      				<td height="55" align="right">
	      				<input type="hidden" value="<?=$id?>" name="txttopid" id="txttopid">
	      				Topic Name :&nbsp;&nbsp;&nbsp;
	      				</td>
	      				<td align="left"><input type="text" value="<?=$top_name?>" name="txttopname" id="txttopname" maxlength="255" style="width: 250px;" /><div id='existing'><?=$error_msg?></div></td>
	      			</tr>
	      			<tr align="center">
	      				<td height="55" align="right">Description :&nbsp;&nbsp;&nbsp;</td>
	      				<td align="left"><input type="text" value="<?=$top_desc?>" name="txttopdesc" id="txttopdesc" maxlength="255" style="width: 250px;" /></td>
	      			</tr>
	      			<tr align="center">
	      				<td height="55" align="right">Max Item :&nbsp;&nbsp;&nbsp;</td>
	      				<td align="left"><input type="text" value="<?=$max?>" name="txtmax" id="txtmax" maxlength="3" style="width: 50px;" /></td>
	      			</tr>
	      			<tr align="center">
	      				<td>&nbsp;</td>
	      				<td height="20" colspan="2" align="left"><br/><input type="button" onclick="javascript:window.location='<?=site_url("vote_management/voteTopic")?>'" style="cursor: pointer;" value="Go Back"/>&nbsp;&nbsp;<input type="button" onclick="javascript:updateTopic('<?=site_url("vote_management/updateTopic")?>')" style="cursor: pointer;" value="Update"/></td>
	      			</tr>
	      		</table>
	      		<?php 
	      			}
	      		?>
	      	</form>
      	</td>
      </tr>
   </table>
</div>
